scrolledwindow: Only start fade animation on "visible" scrollbars
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 24 Feb 2015 13:52:40 +0000 (14:52 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Tue, 24 Feb 2015 13:55:23 +0000 (14:55 +0100)
If a scrollbar is not shown (because of policies, or because it isn't
necessary), it doesn't make sense to start fade animations on its window
on captured motion events.

gtk/gtkscrolledwindow.c

index b3f3770e053d2100ac9267cfbfd06b4bc29abf22..dbc0f159da4130d47704c09e932de07ac7570e28 100644 (file)
@@ -1087,8 +1087,10 @@ captured_event_cb (GtkWidget *widget,
 
   if (event->type == GDK_MOTION_NOTIFY)
     {
-      indicator_start_fade (&priv->hindicator, 1.0);
-      indicator_start_fade (&priv->vindicator, 1.0);
+      if (priv->hscrollbar_visible)
+        indicator_start_fade (&priv->hindicator, 1.0);
+      if (priv->vscrollbar_visible)
+        indicator_start_fade (&priv->vindicator, 1.0);
 
       if ((event->motion.state &
            (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK | GDK_BUTTON3_MASK)) != 0)